A switching power supply device having a power supply circuit and a computing unit is well known. The power supply circuit includes a switching unit provided on the input side. The computing unit derives an output current of the power supply circuit based on a direct current component of the input current of the power supply circuit and a duty ratio of the switching unit.
Moreover, a power supply device having a rectifying circuit, an active filter, a smoothing circuit, and an inverter is well known. The rectifying circuit rectifies a first alternating current voltage. The active filter is provided in the stage subsequent to the rectifying circuit. The smoothing circuit smooths the output voltage of the active filter and generates a direct current voltage. The inverter converts the direct current voltage to a second alternating current voltage. The active filter includes a reactor for receiving the output voltage of the rectifying circuit at one terminal of the reactor, a diode having an anode connected to the other terminal of the reactor and a cathode connected to the smoothing circuit, and a switching element connected between the other terminal of the reactor and a reference voltage line. A microcomputer detects the input current, the input voltage, and the output voltage of the active filter, and controls the ON/OFF of the switching element so that the phases of the input current and the input voltage match and so that the output voltage of the active filter matches a reference voltage based on the detection results. The microcomputer includes a target duty ratio calculating unit, a duty ratio calculating unit, and a signal generating unit. The target duty ratio calculating unit calculates the target duty ratio based on an input voltage, an input current, an output voltage, and a target voltage. The duty ratio calculating unit calculates the duty ratio of the present cycle so that the difference between the target duty ratio calculated by the target duty ratio calculating unit and the duty ratio of the previous cycle gradually becomes smaller. When the input current exceeds a predetermined first threshold value current, or when the output voltage exceeds a predetermined first threshold value voltage, the duty ratio calculating unit instantaneously reduces the duty ratio of the present cycle below the duty ratio of the previous cycle. The signal generating unit generates a control signal for the switching element based on the duty ratio of the present cycle calculated by the duty ratio calculating unit.
When an overcurrent suddenly flows through the power supply circuit, the power supply circuit may be protected by stopping the power supply circuit. However, when a current detecting circuit for detecting the current of the power supply circuit is damaged, the current detecting circuit does not detect the proper current and the power supply circuit is not protected.
The followings are reference documents.    [Document 1] Japanese Laid-open Patent Publication No. 2013-46489 and    [Document 2] Japanese Laid-open Patent Publication No 2010-259153.